char(x::String, position::Int) = x[chr2ind(x, position)]
char_offset_from_end(x::String, position::Int) = x[chr2ind(x, length(x)+1-position)]

function substr(x::String, first_position::Int, final_position::Int)
    return x[chr2ind(x, first_position):chr2ind(x, final_position)]
end

function substr_offset_from_end(x::String, first_from_end_position::Int, final_from_end_position::Int)
    n = length(x)       
    first_position = n - first_from_end_position
    final_position = n - final_from_end_position
    return x[chr2ind(x, first_position):chr2ind(x, final_position)]
end
